************Electoral Rules************
********Interest Group Pressures*******
**and the Price of Democratic Default**
***********BRENDAN J CONNELL***********
***************ISQ*********************
***********Replication File************
*************June, 2019****************

//TABLES

*Table 3
probit debtentry total2 currentaccount logforex gdpgrowth loggdppc if democratic==1, cluster(ccode)
estat class, cutoff(0.5) //% Correctly Predicted
lroc debtentry //AUC

*Table 4
reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1, cluster(ccode)
est store MODEL1, title((1))
heckman haircut persrank rightgov leftgov loggdppc logpop if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODEL2, title((2))
heckman haircut persrank pr rightgov leftgov loggdppc logpop if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODEL3, title((3))
heckman haircut persrank rightgov leftgov loggdppc logpop region1 region2 region3 region4 region5 region6 region7 region8 region9 region10 region11 region12 region13 region14 region15 region16 region17 region18 region19 region20 region21 region22 if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODEL4, title((4))
heckman haircut persrank rightgov leftgov loggdppc logpop debtrestructured brady newmoney if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODEL5, title((5))
heckman haircut persrank rightgov leftgov loggdppc logpop imports_gdp exports_gdp if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODEL6, title((6))
estout MODEL1 MODEL2 MODEL3 MODEL4 MODEL5 MODEL6, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "table4.tex", replace style(tex)

//FIGURES
graph set window fontface "garamond"

*Figure 1
qui reg haircut persrank rightgov leftgov loggdppc logpop, cluster(ccode)
histogram haircut if e(sample), bin(7) percent fcolor(navy) lcolor(white) lpattern(blank) barwidth(12) gap(20)

*Figure 2
qui heckman haircut persrank rightgov leftgov loggdppc logpop if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode) //Model 2
est store MODEL2, title((2))
margins if haircut!=. & democratic==1, at(persrank=(1(1)10)) atmean pred(ycond)
marginsplot, xsize(10) ysize(9) addplot(hist persrank if haircut!=. & democratic==1, yaxis(2) xscale(range(1(1)10)) xlabel(1(1)10) yscale(range(0(10)60)) ylabel() yscale(axis(2) range(0 .75) off) lc(white%0) fcolor(gs10%25) recast(rbar)) recast(line) recastci(rarea) ciopts(fc(emidblue%30) lc(white%0)) xtitle(Personal Vote Index) title("") ytitle(Predicted Sovereign Debt Haircut (%)) legend(off) graphregion(fcolor(white) lcolor(white))

*Figure 3a
qui heckman haircut c.persrank##c.risk_ds1 rightgov leftgov loggdppc logpop if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode) //Model A62
margins if haircut!=. & polity>5 & polity<11, dydx(c.persrank) at(c.risk_ds1=(0(1)10)) atmean pred(ycond)
marginsplot, xsize(10) ysize(9) addplot(hist risk_ds1 if haircut!=. & democratic==1, yaxis(2) xscale(range(0(1)10)) xlabel(0(1)10) yscale(range(-10(1)12)) ylabel(-10(2)12, nogrid) yscale(axis(2) range(0 .5) off) lc(white%0) fcolor(gs10%25) recast(rbar)) recast(line) recastci(rarea) ciopts(fc(emidblue%30) lc(white%0)) xtitle(Debt Service Risk) title("") ytitle(Marginal Effect of Personal Vote Index) legend(off) graphregion(fcolor(white) lcolor(white)) yline(0)

*Figure 3b
qui heckman haircut c.persrank##c.risk_inflation1 rightgov leftgov loggdppc logpop  if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode) //MODEL A65
margins if haircut!=. & polity>5 & polity<11, dydx(c.persrank) at(c.risk_inflation1=(0(1)10)) atmean pred(ycond)
marginsplot, xsize(10) ysize(9) addplot(hist risk_inflation1 if haircut!=. & democratic==1, yaxis(2) xscale(range(0(1)10)) xlabel(0(1)10) yscale(range(-10(1)6)) ylabel(-10(2)6, nogrid) yscale(axis(2) range(0 .5) off) lc(white%0) fcolor(gs10%25) recast(rbar)) recast(line) recastci(rarea) ciopts(fc(emidblue%30) lc(white%0)) xtitle(Inflation Risk) title("") ytitle(Marginal Effect of Personal Vote Index) legend(off) graphregion(fcolor(white) lcolor(white)) yline(0)

*Figure 4
qui heckman haircut democracy_cc democracy_pc autocracy rightgov leftgov loggdppc logpop imports_gdp exports_gdp debtrest brady newmoney inflation gdpgrowth logforex currentaccount, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode) //Model A69
margins if e(sample), at(democracy_cc==1 democracy_pc==0 autocracy==0) at(democracy_cc==0 democracy_pc==1 autocracy==0) at(democracy_cc==0 democracy_pc==0 autocracy==1) atmean pred(ycond)
marginsplot, xsize(10) ysize(9) xtitle() title("") recast(scatter) recastci(rspike) ytitle(Predicted Sovereign Debt Haircut (%)) legend(off) graphregion(fcolor(white) lcolor(white)) level(90)

//Appendix A

*Table A1 - Second Stage Summary Statistics
qui reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1, vce(cluster ccode)
sutex haircut persrank rightgov leftgov loggdppc logpop pr debtrestructured brady newmoney imports_gdp exports_gdp effectparties mdmh pluralty checks govfrac cg gdpgrowth inflation xr currentaccount kaopen logforex ln_unemp_tot budgetbalance_prs world_g_i vxo risk_ds1 risk_inflation1 if e(sample), nobs minmax digits(2)

*Table A2 - First Stage Summary Statistics
qui probit debtentry total2 logforex loggdppc currentaccount gdpgrowth if democratic==1, cluster(ccode)
sutex debtentry total2 logforex loggdppc currentaccount gdpgrowth if e(sample), nobs minmax digits(2)

*Table A3 - Correlation Matrix
qui reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1, vce(cluster ccode)
pwcorr haircut persrank pr rightgov leftgov loggdppc logpop debtrestructured brady newmoney imports_gdp exports_gdp if e(sample)

*Table A4
reg haircut persrank if democratic==1, vce(cluster ccode)
est store MODELA1, title((A1))
reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1, vce(cluster ccode)
est store MODELA2, title((A2))
reg haircut persrank pr rightgov leftgov loggdppc logpop if democratic==1, vce(cluster ccode)
est store MODELA3, title((A3))
reg haircut persrank rightgov leftgov loggdppc logpop region1 region2 region3 region4 region5 region6 region7 region8 region9 region10 region11 region12 region13 region14 region15 region16 region17 region18 region19 region20 region21 region22 if democratic==1, vce(cluster ccode)
est store MODELA4, title((A4))
reg haircut persrank rightgov leftgov loggdppc logpop debtrestructured brady newmoney if democratic==1, vce(cluster ccode)
est store MODELA5, title((A5))
reg haircut persrank rightgov leftgov loggdppc logpop imports_gdp exports_gdp if democratic==1, vce(cluster ccode)
est store MODELA6, title((A6))
estout MODELA1 MODELA2 MODELA3 MODELA4 MODELA5 MODELA6, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "tablea4.tex", replace style(tex)

*Table A5
heckman haircut persrank rightgov leftgov loggdppc logpop effectparties if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA7, title((A7))
heckman haircut persrank rightgov leftgov loggdppc logpop mdmh if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA8, title((A8))
heckman haircut persrank rightgov leftgov loggdppc logpop pluralty if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA9, title((A9))
heckman haircut persrank rightgov leftgov loggdppc logpop govfrac checks if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA10, title((A10))
heckman haircut persrank rightgov leftgov loggdppc logpop effectparties mdmh pluralty checks govfrac if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA11, title((A11))
estout MODELA7 MODELA8 MODELA9 MODELA10 MODELA11, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea5.tex", replace style(tex)

*Table A6
heckman haircut persrank rightgov leftgov loggdppc logpop cg if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA12, title((A12))
heckman haircut persrank rightgov leftgov loggdppc logpop gdpgrowth if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA13, title((A13))
heckman haircut persrank rightgov leftgov loggdppc logpop inflation if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA14, title((A14))
heckman haircut persrank rightgov leftgov loggdppc logpop ln_unemp_tot if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA15, title((A15))
heckman haircut persrank rightgov leftgov loggdppc logpop xr if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA16, title((A16))
heckman haircut persrank rightgov leftgov loggdppc logpop currentaccount if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA17, title((A17))
heckman haircut persrank rightgov leftgov loggdppc logpop budgetbalance_prs if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA18, title((A18))
heckman haircut persrank rightgov leftgov loggdppc logpop kaopen if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA19, title((A19))
heckman haircut persrank rightgov leftgov loggdppc logpop logforex if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA20, title((A20))
heckman haircut persrank rightgov leftgov loggdppc logpop world_g_i if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA21, title((A21))
heckman haircut persrank rightgov leftgov loggdppc logpop vxo if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA22, title((A22))
estout MODELA12 MODELA13 MODELA14 MODELA15 MODELA16 MODELA17 MODELA18 MODELA19 MODELA20 MODELA21 MODELA22, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea6.tex", replace style(tex)

*Table A7
heckman haircut persrank rightgov leftgov loggdppc logpop cg gdpgrowth inflation xr currentaccount kaopen logforex world_g_i if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA23, title((A23))
heckman haircut persrank rightgov leftgov loggdppc logpop cg gdpgrowth inflation xr currentaccount kaopen logforex world_g_i vxo if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA24, title((A24))
reg haircut persrank rightgov leftgov loggdppc logpop cg gdpgrowth inflation xr currentaccount kaopen logforex world_g_i if democratic==1, vce(cluster ccode)
est store MODELA25, title((A25))
reg haircut persrank rightgov leftgov loggdppc logpop cg gdpgrowth inflation xr currentaccount kaopen logforex world_g_i vxo if democratic==1, vce(cluster ccode)
est store MODELA26, title((A26))
estout MODELA23 MODELA24 MODELA25 MODELA26, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea7.tex", replace style(tex)

*Table A8
logit crisis_extdebt persrank ndy ndy2 ndy3 i.year if year<2006 & democratic==1, cluster(ccode)
est store MODELA27, title((A27))
logit crisis_extdebt persrank loggdppc logpop leftgov rightgov logforex currentaccount gdpgrowth ndy ndy2 ndy3 i.year if year<2006 & democratic==1, cluster(ccode)
est store MODELA28, title((A28))
logit crisis_extdebt persrank loggdppc logpop leftgov rightgov logforex currentaccount gdpgrowth crisis_bank crisis_inflation crisis_currency ndy ndy2 ndy3 i.year if year<2006 & democratic==1, cluster(ccode)
est store MODELA29, title((A29))
logit crisis_currency c.persrank loggdppc logpop leftgov rightgov logforex currentaccount gdpgrowth nccy nccy2 nccy3 i.year if year<2006 & democratic==1, cluster(ccode)
est store MODELA30, title((A30))
logit crisis_bank c.persrank loggdppc logpop leftgov rightgov logforex currentaccount gdpgrowth nbcy nbcy2 nbcy3 i.year if year<2006 & democratic==1, cluster(ccode)
est store MODELA31, title((A31))
logit crisis_inflation c.persrank loggdppc logpop leftgov rightgov logforex currentaccount gdpgrowth nicy nicy2 nicy3 i.year if year<2006 & democratic==1, cluster(ccode)
est store MODELA32, title((A32))
estout MODELA27 MODELA28 MODELA29 MODELA30 MODELA31 MODELA32, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "tablea8.tex", replace style(tex)

*Table A9
reg haircut persrank rightgov leftgov loggdppc logpop bankingcrisis_lv if democratic==1, cluster(ccode)
est store MODELA33, title((A33))
heckman haircut persrank rightgov leftgov loggdppc logpop bankingcrisis_lv if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA34, title((A34))
estout MODELA33 MODELA34, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea9.tex", replace style(tex)

**Table A10
heckman haircut persrank if democratic==1, select(total2 regiondebtgdp logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA35, title((A35))
heckman haircut persrank rightgov leftgov loggdppc logpop if democratic==1, select(total2 regiondebtgdp logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA36, title((A36))
heckman haircut persrank pr rightgov leftgov loggdppc logpop if democratic==1, select(total2 regiondebtgdp logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA37, title((A37))
heckman haircut persrank rightgov leftgov loggdppc logpop region1 region2 region3 region4 region5 region6 region7 region8 region9 region10 region11 region12 region13 region14 region15 region16 region17 region18 region19 region20 region21 region22 if democratic==1, select(total2 regiondebtgdp logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA38, title((A38))
heckman haircut persrank rightgov leftgov loggdppc logpop debtrestructured brady newmoney if democratic==1, select(total2 regiondebtgdp logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA39, title((A39))
heckman haircut persrank rightgov leftgov loggdppc logpop imports_gdp exports_gdp if democratic==1, select(total2 regiondebtgdp logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA40, title((A40))
estout MODELA35 MODELA36 MODELA37 MODELA38 MODELA39 MODELA40, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea10.tex", replace style(tex)

*Table A11
heckman haircut persrank if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg) vce(cluster ccode)
est store MODELA41, title((A41))
heckman haircut persrank rightgov leftgov loggdppc logpop if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg) vce(cluster ccode)
est store MODELA42, title((A42))
heckman haircut persrank pr rightgov leftgov loggdppc logpop if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg) vce(cluster ccode)
est store MODELA43, title((A43))
heckman haircut persrank rightgov leftgov loggdppc logpop region1 region2 region3 region4 region5 region6 region7 region8 region9 region10 region11 region12 region13 region14 region15 region16 region17 region18 region19 region20 region21 region22 if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg) vce(cluster ccode)
est store MODELA44, title((A44))
heckman haircut persrank rightgov leftgov loggdppc logpop debtrestructured brady newmoney if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg) vce(cluster ccode)
est store MODELA45, title((A45))
heckman haircut persrank rightgov leftgov loggdppc logpop imports_gdp exports_gdp if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg) vce(cluster ccode)
est store MODELA46, title((A46))
estout MODELA41 MODELA42 MODELA43 MODELA44 MODELA45 MODELA46, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea11.tex", replace style(tex)

*Table A12
heckman haircut persrank if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg e_persrank rightgov leftgov logpop) vce(cluster ccode)
est store MODELA47, title((A47))
heckman haircut persrank rightgov leftgov loggdppc logpop if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg e_persrank rightgov leftgov logpop) vce(cluster ccode)
est store MODELA48, title((A48))
heckman haircut persrank pr rightgov leftgov loggdppc logpop if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg e_persrank rightgov leftgov logpop) vce(cluster ccode)
est store MODELA49, title((A49))
heckman haircut persrank rightgov leftgov loggdppc logpop region1 region2 region3 region4 region5 region6 region7 region8 region9 region10 region11 region12 region13 region14 region15 region16 region17 region18 region19 region20 region21 region22 if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg e_persrank rightgov leftgov logpop) vce(cluster ccode)
est store MODELA50, title((A50))
heckman haircut persrank rightgov leftgov loggdppc logpop debtrestructured brady newmoney if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg e_persrank rightgov leftgov logpop) vce(cluster ccode)
est store MODELA51, title((A51))
heckman haircut persrank rightgov leftgov loggdppc logpop imports_gdp exports_gdp if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth cg e_persrank rightgov leftgov logpop) vce(cluster ccode)
est store MODELA52, title((A52))
estout MODELA47 MODELA48 MODELA49 MODELA50 MODELA51 MODELA52, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea12.tex", replace style(tex)

*Table A13
heckman haircut persrank rightgov leftgov loggdppc logpop if democracy==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA53, title((A53))
heckman haircut persrank rightgov leftgov loggdppc logpop if FH=="F", select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA54, title((A54))
heckman haircut persrank rightgov leftgov loggdppc logpop if FH=="PF" | FH=="F", select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA55, title((A55))
estout MODELA53 MODELA54 MODELA55, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea13.tex", replace style(tex)

*Table A14
heckman haircut persrank rightgov leftgov loggdppc logpop polity, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA56, title((A56))
heckman haircut persrank pr rightgov leftgov loggdppc logpop polity, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA57, title((A57))
heckman haircut persrank rightgov leftgov loggdppc logpop polity region1 region2 region3 region4 region5 region6 region7 region8 region9 region10 region11 region12 region13 region14 region15 region16 region17 region18 region19 region20 region21 region22, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA58, title((A58))
heckman haircut persrank rightgov leftgov loggdppc logpop polity debtrestructured brady newmoney, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA59, title((A59))
heckman haircut persrank rightgov leftgov loggdppc logpop polity imports_gdp exports_gdp, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA60, title((A60))
estout MODELA56 MODELA57 MODELA58 MODELA59 MODELA60, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea14.tex", replace style(tex)

*Table A15
heckman haircut c.persrank c.risk_ds1 rightgov leftgov loggdppc logpop  if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA61, title((A61))
heckman haircut c.persrank##c.risk_ds1 rightgov leftgov loggdppc logpop if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA62, title((A62))
reg haircut c.persrank##c.risk_ds1 rightgov leftgov loggdppc logpop  if democratic==1, vce(cluster ccode)
estimates store MODELA63, title((A63))
heckman haircut c.persrank c.risk_inflation1 rightgov leftgov loggdppc logpop  if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA64, title((A64))
heckman haircut c.persrank##c.risk_inflation1 rightgov leftgov loggdppc logpop  if democratic==1, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA65, title((A65))
reg haircut c.persrank##c.risk_inflation1 rightgov leftgov loggdppc logpop  if democratic==1, vce(cluster ccode)
est store MODELA66, title((A66))
estout MODELA61 MODELA62 MODELA63 MODELA64 MODELA65 MODELA66, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea15.tex", replace style(tex)

*Table A16
heckman haircut democracy_cc democracy_pc autocracy, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA67, title((A67))
heckman haircut democracy_cc democracy_pc autocracy rightgov leftgov loggdppc logpop imports_gdp exports_gdp debtrest brady newmoney, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA68, title((A68))
heckman haircut democracy_cc democracy_pc autocracy rightgov leftgov loggdppc logpop imports_gdp exports_gdp debtrest brady newmoney inflation gdpgrowth logforex currentaccount, select(total2 logforex loggdppc currentaccount gdpgrowth) vce(cluster ccode)
est store MODELA69, title((A69))
reg haircut democracy_cc democracy_pc, vce(cluster ccode)
est store MODELA70, title((A70))
reg haircut democracy_cc democracy_pc rightgov leftgov loggdppc logpop imports_gdp exports_gdp debtrest brady newmoney, vce(cluster ccode)
est store MODELA71, title((A71))
reg haircut democracy_cc democracy_pc rightgov leftgov loggdppc logpop imports_gdp exports_gdp debtrest brady newmoney inflation gdpgrowth logforex currentaccount, vce(cluster ccode)
est store MODELA72, title((A72))
estout MODELA67 MODELA68 MODELA69 MODELA70 MODELA71 MODELA72, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(lambda N r2, fmt(3 0 3) label($\lambda$ Observations R$^2$)) label,  using "tablea16.tex", replace style(tex)


//APPENDIX SECTION C/D: SENSITIVITY ANALYSIS
*DF BETAS
qui reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1
dfbeta
list _dfbeta_1 country ccode year if abs(_dfbeta_1)>2/(46^.5) & _dfbeta_1!=.
gen outlier_dfbeta = 0
replace outlier_dfbeta = 1 if abs(_dfbeta_1)>2/(46^.5) & _dfbeta_1!=.
list countryyear if outlier_dfbeta==1
gen dummy1 = 0
replace dummy1 = 1 if countryyear== 511978
gen dummy2 = 0
replace dummy2 = 1 if countryyear== 511979
gen dummy3 = 0
replace dummy3 = 1 if countryyear== 3652000
gen dummy4 = 0
replace dummy4 = 1 if countryyear== 3691999
gen dummy5 = 0
replace dummy5 = 1 if countryyear== 5511994
gen dummy6 = 0
replace dummy6 = 1 if countryyear== 3502012

*STUDENTIZED AND STANDARDIZED RESIDUALS
qui reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1
predict esta if e(sample), rstandard
predict estu if e(sample), rstudent
list countryyear if estu>abs(2) & estu!=.
gen outlier_rstu=0
replace outlier_rstu=1 if estu>abs(2) & estu!=.
list countryyear if esta>abs(2) & esta!=.

*LEVERAGE: COOKS DISTANCES & DFFITS
qui reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1
predict cook, cooksd, if e(sample)
gen outlier_cooks = 0
replace outlier_cooks = 1 if cook>(4/46) & cook!=.
qui reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1
predict dffits, dfit, if e(sample)
gen outlier_dffit = 0
replace outlier_dffit = 1 if dffits>(2*((7/46)^.5)) & dffits!=.

*Table A19
reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1, cluster(ccode)
est store MODELD1, title((D1))
rreg haircut persrank rightgov leftgov loggdppc logpop if democratic==1
est store MODELD2, title((D2))
bound haircut persrank rightgov leftgov loggdppc logpop if democratic==1, table gen(weights) //May need to install bound.ado
est store MODELD3, title((D3))
list country year weights if e(sample) //For Table A18 Weights
set seed 87934
bootstrap, reps(1000): reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1
est store MODELD4, title((D4))
reg haircut persrank rightgov leftgov loggdppc logpop if democratic==1 & outlier_dfbeta==0, cluster(ccode)
est store MODELD5, title((D5))
reg haircut persrank rightgov leftgov loggdppc logpop dummy1 dummy2 dummy3 dummy4 dummy5 if democratic==1, cluster(ccode)
est store MODELD6, title((D6))
estout MODELD1 MODELD2 MODELD3 MODELD4 MODELD5 MODELD6, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "tablea19.tex", replace style(tex)

*Table A17
list country year _dfbeta_1 dffits cook estu esta if e(sample)
